package com.block.datapush.form.item.util;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;
import com.block.db.entity.MemberExtInfo;

import java.util.Arrays;
import java.util.List;

public class ZhongXinUtil {

    private static List<String> cityList = Arrays.asList("北京市", "天津市", "上海市", "重庆市");

    public static String getLocation(MemberExtInfo memberExtInfo){
        if (cityList.contains(memberExtInfo.getProvince())){
            return StrUtil.format("{}/{}", memberExtInfo.getProvince(), memberExtInfo.getProvince());
        }
        return StrUtil.format("{}/{}", memberExtInfo.getProvince(), memberExtInfo.getCity());

    }

    public static String getZhima(String zhima){
        if (StrUtil.equals(BaseTypeInfoEnum.ZhimaScore.zm001.getValue(), zhima)){
            return "0";
        }else if (StrUtil.equals(BaseTypeInfoEnum.ZhimaScore.zm002.getValue(), zhima)){
            return "599";
        }else if (StrUtil.equals(BaseTypeInfoEnum.ZhimaScore.zm003.getValue(), zhima)){
            return "649";
        }else if (StrUtil.equals(BaseTypeInfoEnum.ZhimaScore.zm004.getValue(), zhima)){
            return "699";
        }else if (StrUtil.equals(BaseTypeInfoEnum.ZhimaScore.zm005.getValue(), zhima)){
            return "750";
        }
        return "0";
    }
}
